package com.qf.test;

import com.qf.web.StudentServlet;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 2019/11/11
 * Administrator
 * spring1111
 * 面向对象面向君  不负代码不负卿
 */
public class Demo1 {
    public static void main(String[] args) {
      //直接获得spring容器中的对象
          //1.加载spring配置文件
        ApplicationContext app= new ClassPathXmlApplicationContext("spring.xml");
        //2.得到对象
     // StudentServlet studentServlet1=(StudentServlet) app.getBean("servleta");
        StudentServlet studentServlet1=(StudentServlet) app.getBean("servletc");
       // StudentServlet studentServlet2=(StudentServlet) app.getBean("servleta");
       // System.out.println(studentServlet1);
       // System.out.println(studentServlet2);
      //  studentServlet.test();
    }
}
